Tom, if what you want is just to create a regular shadow, Jojaa put you in the right direction.
You don't need any contribution passes for that, but just the -Use background- shader that you can find in the -Create Maya Nodes- tab in Hypershade.
Just create a plane that match in perspective with your real photo, and assign the material -Use Background- which's created for that purpose (for catching reflections too).
If you want just the shadow, set reflectivity and reflection limit to zero (keep shadow mask to 1. You always can remove opacity to your compositing layer)
Additionally, if you want to "substract" elements from the scene (i.e. the character) then create a -Surface Shader-, set Out Matte Opacity to black, and assign it to the element/s that you want to remove.
It's quite easy in that way.
Cheers,
Carles