This will only work when the computer is in sleep or hibernate state:
the easy solution: just schedule a task, and check the 'wake system to run this task' box.
doing it in C/C++: read
This[
^]
Note that this will only work if the system is in the S3 or S4 state as stated above.
If the computer has been shutdown or powered off by other means, this will not work. It will also only work if the kit has an ACPI-compliant bios (Starting with Vista, windows does not accept anything else). Your mileage on XP may vary.
Some computers have a bios that allow you to setup a waking time through the setup screen. This is not controlled by windows, and controlling that requires a specific BIOS device driver.