According to the Chinese immigration law, if your visa has been expired less than 10 days, it's not necessary to pay any fine. You should go to the immigration office, where the officer will ask some questions and make a record of your statement. The officer will also tell you not to let your visa expire again.
If your visa has been expired more than 10 days, they will charge you a fine. The fine is 500 yuan per day except the first 10 days, and the maximum is 5,000 yuan. For example, if you overstay 12 days, they will charge (12-10)*500=1000 yuan.
This is the contact information for the immigration office; you can go there when your visa expires:
Address: No. 1500 Min Shen Rd. , PuDong, Shanghai, China.
Telephone: 021-2895 1900
(China.org.cn March 16, 2007)