The simplest solution (and as a result the simplest to circumvent) is to store the date the program is first installed (or run) in a file and then check that against the current date whenever the program is launched. If the difference is > 30 days then exit the program.
By storing the date in more obscure places or places that are harder for the user to tamper with (such as the registry) then it gets progressively harder for them to circumvent the system and get more time to use it, but doesn't stop them rewinding the clock on their PC.
If you store the date on your server and also get the date from your server then this is more secure, but does mean that the user has to have an open internet connection to use your software.