You can use free project Libprot. The site is https://github.com/libprot/trunk.
The idea is that it should be simple and easy to use. You can spend $$$ on protection but it may be hacked in one week. If someone wants to do reverse engineering of your code then no one can stop it. My advice to use simple methods that works.
Write a string like:
Company X|10.2.2014|1.12.2015
where 10.2.2014 is current date and if the system time is less then someone changed system clock => we should not run
1.12.2015 - until what time the key is valid
and name of company who bought/downloaded it.
that string should be obfuscated with asymmetric algorithm with private/public key and encoded into string that you may send by e-mail, for example.
you may also want to have some web service for validation. when internet connection is on you may validate the key, if it's hacked and available for public in internet you may ban it. Or if someone would write key generator you may validate that key is real.
you can add some PHP/java script in your site to automatically send trial codes.