Embedding CGI into live action

Okay, I’ve searched everywhere and I can’t find an answer to this. How do you make your CG elements look as if they are behind parts of the footage in blender?

Thanks

I’m guessing, but you could use a mask:-
http://www.vimeo.com/Blender3D