Dragging and trowing square MCs with inertia and ease

Have a square MC, and I have to be able to drag and throw it on the screen…

This is no problem.

What I don´t know how to do is to make the square “spin” when dragged from a corner with inertia and easing.

Does anybody know a tutorial on this?
Thanks