Simplest way is to use a hardware dongle. This could be as simple as a USB key with a specific "validation" file hidden on it, or something more complicated like
these[
^].
The only other way I've figured out to do it is a 2-way activation system...
You give a product key, the user enters it. The software collects information that uniquely identifies the system and sends this along with the product key to the server. The server checks if the key has been used and if not, sends back an activation code.