Blend shadow casted by a 3d object over an object in real-life footage (VFX)
As for the floor, you should add a transparent object receiving shadows.

Since Cycles has been thought for photo-realistic renders, there's no easy way to isolate shadows.

You can use Layer and Render Passes.

Foreground

This layer contains all you want to render (your character)



Transparent objects receiveing shadows

This layer contains the helper objects that will receive shadows (the puppet).

Since we won't use any color informations, we'll use the Diffuse Direct Pass.



Background

This layer contains the shadow of our hero.

To avoid the "helper object" to cast any shadow, we'll exclude its layer.



Background image



Scene



Composite



Use the RGB Curve Nodes to adjust the shadows and to set the white level (white is transparent in Multiply Node)