Zeds is a Windows application that quite simply helps you get to sleep at the most efficient time, based on the time you need to get up in the morning.
Primarily based on the 90 minute sleep cycle theory, Zeds will calculate the best bedtimes for you and allow you to select which one you'd like (while showing you how much sleep you'll get) - it'll then wake you up by playing an alarm.
Zeds will also take into account the length of time you need to fall asleep, notifying you in the task area of the Windows desktop 15 minutes (by default) before your bedtime so that you can get into bed and start your sleep cycles at the correct time.
All of this is configurable using the settings screen so that you can adjust Zeds to your exact requirements.
Zeds is open source, built in ASP.NET WebForms using C# - it requires .NET Framework 4.5 although I'm pretty sure it'll compile to lower versions.
You can view the source by visiting http://github.com/woodss/zeds;