Today I finally had time to start reading Mastering OpenCV with Practical Computer Vision Projects (an excellent book by the way I highly recommend it to anyone who uses or is interested in OpenCV), the third chapter on Marker-less augmented reality really peaked my interest. A while back I posted a video I took at the Lego store of a really cool computer vision/augmented reality application (link). At the time I was pretty sure I knew how it worked and reading this chapter confirmed that I was probably right. The example in the book even used a Lego box as the example! The processes is actually fairly straight forward it uses feature matching to recognize the object and then calculates the homography using some refinement steps. The system uses a calibrated camera and is then able to draw 3D objects into the frame with realistic perspective etc.
The authors of the book have been kind of enough to post all their source code over on github, check it out: github.com/MasteringOpenCV/code