As Benjamin said, this is quite easy with CS6's new 3D tracker, and as John said, if you need to do it today, CAMERATRACKER from The Foundry is a great choice.
One thing to add, though -- camera tracking doesn't necessarily obviate the need for
rotoscoping [link]. If you want the 3D text to obscured by other objects in your footage, you may need to do some roto to generate a matte.
Walter Soyka
Principal & Designer at
Keen Live
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
RenderBreak Blog - What I'm thinking when my workstation's thinking
Creative Cow Forum Host: Live & Stage Events