Look up FindFirstUrlCacheEntry() and the related functions. Here's some code for a console app that prints all history item to stdout. The history view you see in Explorer is generated by a namespace extension.
#define WIN32_LEAN_AND_MEAN
#include <afxwin.h>
#include <tchar.h>
#include <wininet.h>
#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
HANDLE hFind;
BYTE byBuffer[16384];
INTERNET_CACHE_ENTRY_INFO* pInfo = (INTERNET_CACHE_ENTRY_INFO*) &byBuffer[0];
DWORD dwSize = sizeof(byBuffer);
pInfo->dwStructSize = sizeof(INTERNET\_CACHE\_ENTRY\_INFO);
hFind = FindFirstUrlCacheEntry ( \_T("visited:"), pInfo, &dwSize );
if ( NULL != hFind )
{
do
{
cout << "lpstrSourceUrlName = " << pInfo->lpszSourceUrlName << endl
<< "Times visited = " << pInfo->dwHitRate << endl
<< "Last time visited = ";
CTime t ( pInfo->LastAccessTime );
cout << (LPCTSTR) t.Format( "%b %d, %Y at %H:%M:%S" ) << endl << endl;
dwSize = sizeof(byBuffer);
} while ( FindNextUrlCacheEntry ( hFind, pInfo, &dwSize ));
FindCloseUrlCache ( hFind );
}
return 0;
}