There are four ways to confirm a key.
- Simple compare to an existing string in the exe (extremely easy to crack)
- Algorithmic compare to an entered string of characters (almost as easy as #1. Depends entirely on the reverse engineering skills of the cracker).
- Compare with a server over the internet. (can be circumvented)
- Hardware dongle.
Depending on the product you have from microsoft, they use one of the first 3 mechanisms above. For example, their OS's usually phone home; but their dev tools either have the key baked in or do an algorithmic compare. Some of their older OS's used to do the algorithm.
There is a modified option 3, but that is simply having the app phone home every so often, typically based on some event. In the case of OS's, MS has it validate the entered product key for certain windows updates and other product downloads. Also, depending on the license key itself it might phone home once a month or so. As a side note, there is a reason why China has the #1 installed base of IE6.
The 4th option can also be circumvented. Usually the cracker will just patch your product to bypass the part of the code which does the hardware check.