Producing closely fitting parts I would really like to be able to print moving parts that fit well enough to move without excessive friction, but also aren't excessively loose.  Using an Ultimaker 2, what should be my expectations be, and how would I go about produce well fitting parts?

Using a tool like Openscad to generate parametric parts is really useful because it facilitates the creation of geometrically precise parts such as cogs and drive shafts, which also have precise dimensions.  The problem arises when the parts are printed and joined together.  

I recently printed some cogs that were supposed to be able to rotate freely around a shaft, which was also printed.  I made the shaft about 0.1 mm smaller than the center hole of the cog expecting it to be able to rotate freely, however I found that I had to bore out the center hole slightly and sand down the shaft.  I then found that the boring was imprecise and the center of rotation was off center.
There are a lot of factors to 3D printing parts that work and fit together. 

A lot of it will be discovered by trial and error, but let's try to put you on the right path. 

First your material is what matters the most. Specifically their coefficient of thermal expansion, i.e. how much can the plastic change when heat is applied. PLA's coefficient is low compared to ABS, for example. Which is why the MakerBot can print without a heated bed, but it cannot print ABS with any success.

Here is a list of coefficient of thermal expansions by material.

What you want to do next is to print out a few test items and see for yourself. Below is an example of reality vs. expectation. As you can see the circle shrinks. It will never expand. So you will always make it bigger than you need. It is also good to note in this example below that the block itself is Larger than expected. The best solution is to not expect high tolerances and build a lot of flex into your designs.



Generally you want the hole size larger. If I wanted a 4 mm minimum hole, then I would likely make it 5+ mm.

The best thing you can do is print out a tray and document how different the sizes are. Also, do the same with a print of various peg sizes. Below is an example of such a tray.




Also, you might want to look into other materials such as Nylon and Carbon fiber.
A great source of more tips. Here is a great tutorial, Designing Mechanical Parts - The Whoosh Machine by shapeways, on designing parts.
A RepRap Wiki article on different lubricants in regards to 3D printers. Most people use silicon lube for parts to my knowledge. Again, it depends on your material. 


Images taken from this link, The Innovation Station - Tips for Designing 3D Printed Parts.