People argue this continuously. Yes, I know that people claim to do it all the time. They put a lot of trust on their 10mm's extractor to hold the 40 casing. It may work. Until it doesn't. It only takes one not to work to ruin your day.
Anyway, I was surprised to find this from Speer's FAQ: http://www.speer-ammo.com/general/faq.aspx#q25
Q. Can I shoot 40 S&W ammo in my 10mm pistol? The case is identical except for length.
A. No. Both headspace on the case mouth. The shorter 40 S&W will not be supported in the 10mm chamber, so headspace control is lost. You'll get misfires, blown primers, deformed cases and, potentially, gas jetting from the action. Always use the correct ammunition for your firearm. Don't cut corners!