Binding something to a moving object
What you're looking for is Motion Tracking. There are a number of tools which have motion trackers in them - Apple's Motion, Adobe After Effects, and more. There are also 3rd party trackers like Mocha, Core Melt Track X, etc.

The workflow will differ depending on which tool you're using, so I can't really get into details here. But you should be able to find tutorials on YouTube and at the vendors' websites.