Rim, on a manhole, also Top of Grate on an inlet, is the elevation of the top of the cover on the manhole, or the inlet grate on an inlet. In a roadway, they darned well better be final grade, in grass they can be sumped, flush or stick up.
Invert of the pipes in and out is the elevation at the bottom of the inside pipe wall, not the bottom of the pipe.
Invert of the structure (MH or inlet) is the bottom of the inside of the structure, not the excavation depth.
Engineering is the practice of the art of science - Steve