Find a tutorial on CSS3 'transition', 'transform' and the 'rotate' function.
It's easy enough to do, but it isn't supported well in most versions of Internet Explorer. You also want to be extremely cautious about adding unusual visual effects to important user interface elements like a log-in button. When its an important function that involves personal data like their log-in credentials, you want to keep users as comfortable as possible. In most cases, I'd say a twirling log-in button would be a bad idea.