Producing closely fitting parts
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.