Here are the tutorials you asked for:
Its just the matter of creating the mask in an appropriate tool
If its a static mask you just need image editing, if you want a dynamic mask (video) you have to create an animation of the mask. The latter is (of course) more complex and you need a special animation tool and knowledge.
The other problem is one might tend to overdue it with masking and esp. dynamic masking. The examples above imho show what i mean. Its nice when it really fits to the scene but in most cases - as with any special effects - its getting boring after a while and does not really fit to the atmosphere and is more or less confusing.