This is how I do it, I mask all windows, cabinets and anything I don't want paint on, if the floors are out I don't mask the floor unless tile or concrete is going down. I take all of the doors out and mark each one on the bottom with masking tape so I know where it goes back. I take off all door hardware, switch plates etc. it makes the job look much more professional this way.
I paint the ceiling first, I take out all lights and replace them with a cheap plastic round closet light with bulb that hangs by the wires so you can paint under it, then mask the ceiling back 2' then take a paint brush and paint the ceiling color over the edge of the the taped off area. This will allow the ceiling paint to run under the tape and fill the voids making a super crisp tape line when you paint the walls.
Next I do walls and try to avoid spraying too much on the jambs but I don't mask them, it takes way too much time. If you have different wall colors see my masking tip above.
To paint the trim I do a fast masking job on places where the paint might drip but I cut the paint in with a brush so I don't need to mask. (anyone can learn to cut paint in with practice and it is twice as fast as masking) If a room has carpet I have a lot of left over 2" blind slats I shove under the base boards to allow me to paint them real nice without getting paint on the carpet. I use a 12" masking paper over them and many large canvas tarps for perfect results.
This is just a general overview but I hope it helps.
Here is a good video on how to paint trim.
http://www.youtube.com/watch?v=dH-7rg2E8_I&feature=youtube_gdata_player