something like this for the PC: http://www.tomshardware.com/reviews/bios-beginners,1126-8.html Look at AC Power Loss Restart
Also look at smart power strips. They have a master plug which when active will automatically send power to all other devices.
So plug your TV into the master plug of the power strip and PC (set to auto wake) into a slave plug on the strip. When the TV is turned on then the PC turns on. If the TV is turned off then the PC power is automatically cut. (of course this method risks disk corruption)
You can do the reverse if the TV is set to turn on automatically. Sometimes this requires some soldering of the powerbutton.
There are many other ways to accomplish such a feat.