In addition to Polk in 1844:
- Woodrow Wilson lost New Jersey in 1916 but won.
But does this really answer your question? You said,
It got me thinking, has a candidate ever lost his home state and then went on to win his party's primaries and eventually become president?
This implies to me that you are talking about losing the home state in the primaries rather than the general election. In 1844, they didn't even have primaries, just conventions. 1912 was the first election where there was a presidential primary and that just in twelve states. It wasn't until 1972 that primaries became the norm.
And if that's the case, then the most recent winner is Richard Nixon. He lost California in 1968 to Ronald Reagan but won the nomination and the general election. Nixon won nine of the twelve Republican primaries that year, but not his home state of California.
There may be others in the 1912-1964 period, but I didn't find an easy to browse source for older elections. Carter, Reagan, Bush, Clinton, Bush, and Obama all carried their respective home states when they won.