As a custom homebuilder, here are the standards that my company followed for trim work, and a few comments about what has been posted so far. 95% of my homes had painted trim that was spray painted with the top coats, and was smooth as glass when finished.
The do list.
1-Use pre-primed, finger jointed stock. Not only is this stuff ready to paint, it typically really high quality, knot and defect free, and often manufactured from Poplar, which is a great hardwood for this application. We would lay all the material on sawhorses, out in the yard and spray one coat on it, before installation, then a second coat after it was installed. As a homeowner, I would definitely put one top coat on before installation, using a foam roller for the flat surfaces.
2-Purchase the entire job at once, from a local lumberyard. The big box stores can literally be priced double what I pay, if you head in for a few pieces at a time. Get a material list together, talk to the contractor sales desk at a local yard and tell them you are paying cash for the best price on all new trim for your house.
3-Learn to cope corners. The technique involves a 45* cut on the face, flip the board, back-cut the material to remove most of the cope, leaving the shaped area, finish with a coping saw. Once you get the hag of it, it takes 2-3 minutes to product a quality job.
4-Only cope one end of a wall, the other butts into the drywall, or a door jamb leg. Cut the piece 1/16th long and spring it into place. This allows the fairly sharp cope to dig into the corner and look good, while staying tight.
5- Nail with an air-nailer. No exceptions, if you are going to re-trim a house buy one. Hand nailing of fingerjoint trim will not end well.
6- Find the studs and nail to every one. Use a stud finder, or pull a plate off an outlet and look for the stud that the box is nailed on. Find one stud and stretch a tape measure on the floor to indicate where all the other studs are. Shot the base to the wall by using the 16" marks on the tape as a guide.
7-Fill nail holes with quick drying drywall "patching" compound. This comes in little tubs and is perfect for this use.
8-Run a bead of latex painter's caulk on the top edge when you are done. Use a finger and a wet rag to tool the joint.
Don't list.
1- No MDF baseboard or casing ever. The stuff is shit, and not worthy of anything but kindling to start a campfire.
2- Never attach anything to a wall with construction adhesive unless there is nothing behind it to nail to. This stuff makes the paper face of the sheetrock and the trim one. If you have to remove it later, it will tear huge chunks out of the wall.
3- Avoid shoe mold and quarter round where possible. If the rooms are getting carpet, use 1/2" spacers to keep baseboard off the floor an provide a nice permanent groove to tuck carpet into. Hard floors should be trimmed after installation.