The most prevalent way is a phone-home approach. After registration, your app will contact a server you control and send registration information. You would check the key against a database. If its new, allow registration. Otherwise deny registration.
This is a simple approach, but is not very userfriendly.
Problem 1: User reformats computer/computer dies/changes computer. In this scenario, your customer will not be able to reinstall the software they paid for. One solution is to have them contact you, and you will send them a new key.
Problem 2: User doesn't have internet access: Solution: make your application available online only.
Problem 3: A user uninstalls their program, then wishes to reinstall later. Solution: During uninstall, you will have to contact your registration server and remove the key.
Realize that your goal should be to keep the honest people honest. People who will pirate your stuff can easily defeat your best attempts at copy protection. Keep it simple, and dont spend too much time on it and deal with more important problems.