There are several ways to do this but cost is an issue I bet. The best and most fool proof way would be to have a controller that picked up on the state of the computer and turned things on and off accordingly. This could be done with a EMF sensor or a LED sensor to sense the computers state and something like a Houselinc controller that has some logic and knows when to do if it’s on or off.
Otherwise, you’re going to need a software package that you can trigger to send commands on power up and on power down. The problem is having the command sent on power down. Since it’s a computer, when you choose to shut down, you will need to have a command in the shutdown sequence to trigger an event before it shuts down. I don’t know that any of the automation software has this built in but you may want to check out a program called Automate from a company named Unisyn. It’s a great program and can do a lot of neat stuff with your computer.
If money were no object, use a controller and have it check the PC status every 5 min or so and do commands based on the PC’s status.