Hi Kumar,
I can't give you the full details of what we used in our commercial application, but the basic idea we had was to issue customers keys which they had to purchase in order to operate the application. The keys could be for 3, 6, or 12 months duration, after which they would expire and clients would need to purchase a new key to continue using the application.
The key itself was just a string. We developed an algorithm, which was the main part of this task, and this would take a client id, expiry date and some other details, and use those details to generate a key. Using the algorithm, this key could then be decoded to determine which client it applies to and what the key's expiry date is.
So the basic process was - customer gives us money, we give them the application and key code. They then have to enter the key which was provided, and this is encrypted and saved in a DB table. Each time someone logs on, the key value as saved in that table can be checked to make sure that it's a valid key, it's used for the correct client, that it hasn't expired yet, and take appropriate action based on that.
Hope this points you in the right direction,
Nathan