I haven't replaced a Shimano sealed bearing cartridge in a while. But, from what I remember, the Non-Adjustable cup with the flange on it (that doesn't come off the bottom bracket) is the drive side. The cup that comes off the bottom bracket that does not have a flange is the Non-Driveside cup.
Grease the threads of the Non-Adjustable Driveside cup and screw it in until the flange is tight against the frame. Use a torque wrench to tighten to the Manufacturer's spec. Then, grease the treads of the Non-Driveside cup, and grease the inside of the Non-driveside cup. Screw the Non-driveside cup in until it bottoms on the bottom bracket, and use the torque wrench to tighten to spec.