This is a template that will help you join two pieces of wood with 3/8" dowels. There are actually two templates, one with a tab on each side that will just fit over two 2x4's (ie 3 inches), and one with only a single tab, that you can use at the end of any piece of wood.
Basically you clamp a guide onto each piece, and then drill through the holes with a 3/8" bit, to the depth necessary on each side to join your pieces. The holes are slightly under-sized so you will take a bit of plastic off the first time. But after that it should work well. I designed these for a bed-building project, and the fit was excellent (ie no difficultly fitting pieces together, and minimal mis-alignment).
I printed on a Makerbot Replicator 2, Low quality setting, With Support, and 30% inflll (for stiffness). You could go even higher on the infill, to minimize wobble while you drill.
If you want to drill-through two pieces, you can also do it with this guide, using the method from my 5-hole template: http://www.thingiverse.com/thing:673565