I know 1,000+ different ways to setup and build an activation for software. However, the time it would take for me to explain any one of them in great detail is too large.
So, I will give you the fist of 1 simple way, and you can build on that.
Server Side:
Server-Side web-application (PHP/ASP etc) will connect to a database and read out known keys for an application. If the key has been accepted and the product is ok to be activated them it will return an xml-document through a web-interface.
Client-Side:
An XML parser will generate application information and then send a request to the web-server for activation. It will then parse the returning XML document and decide what to do based on this. Local information is stored in the registry on Windows/Configuration files on Linux.
That should be more than enough for you to work out a simple Activation system. NO activation system is un-crackable. None, regardless.
Now, Before you ask another question. Read this:
http://www.cplusplus.com/forum/articles/1295/
As this question isn't exactly C++ related.