I travel regularly to Hangzhou and have done exactly as you are describing. The first time I tried it, I scheduled a flight from HGH to arrive in PEK 3 hours before my UA flight left for SFO. Unfortunately, I missed my flight because I checked in 44 minutes before it took off and the cut off in China is 45 minutes and there is no way to make an exception.
I digress though. So, I took the next flight, arrived 2 hours before in PEK and had plenty of time to make it.
I have also done HGH to PVG. I typically leave Hangzhou the eveinging before, stay at a hotel in Pudong the night, and then take the Mag Lev to the airport the morning of the flight.
The nice thing about the Mag Lev is it takes much of the traffic out of play since it cover the 40 miles in 8 minutes.
I have also taken the high speed train many times between Hangzhou and Shanghai. They run more frequently than every hour as the previous poster said. It would be very easy to take a train that leaves before 9:00 am that would arrive at either Hongqiao or Shanghai South, or Shanghai main and arrive by 10:00 am at the latest and be at PVG via either taxi or mag lev. by 11:00 am.
I hope that helps.
Tad