For FREE historical stock quotes (open, high, low, close, ...) you can get it from Yahoo Finance as a csv file and then parse that. To get intraday values you need to sign up for the TDAmeritrade API (there may be other ways). I've build products using both and Yahoo would be the simpler of the 2.
Best Answer
I take no credit for this. Scalped from http://codingforums.com/showthread.php?t=164998