With the exception of battery replacement, Apple charges a uniform $199 for all out-of-warranty "repairs" for the 8GB iPhone 3G, and $299 for all out-of-warranty "repairs" for the 16GB iPhone 3G. (For battery replacement, if there's absolutely nothing else wrong with the iPod physically, Apple charges a uniform $79.)
For the original iPhone, the price is $199 for all 4GB and 8GB iPhones, and $249 for all 16GB iPhones.
http://www.apple.com/support/iphone/service/faq/#warranty7
It doesn't matter what the nature of the damage is, as long as Apple deems it to be "repairable". The price is always the same. (If it isn't repairable, Apple will send it back to you. Normally, "not repairable" means that it was exposed to liquid or has been disassembled into multiple pieces, but it may also be due to other causes.)
You don't actually get your iPhone repaired if you send it in to Apple, by the way. Apple sends you back a replacement unit (either new or refurbished). Then Apple attempts to refurbish your old iPhone and either use it as a replacement for somebody else's "repair" job, or else sell it in the Refurbished section of Apple's online store.