Start here http://weblogs.asp.net/steveschofield/archive/2007/12/20/iis7-post-57-how-to-setup-odbc-logging-in-iis-7-0.aspx
Personally I haven't ever done this; rather I have setup a script to import old IIS logfiles into a SQL DB with Logparser.
Here is the PowerShell script I use
### Parameters ###
$iisLogLocation = "$env:systemdrive\inetpub\logs\logfiles"
$logParserLocation = "C:\Program Files\Log Parser 2.2"
### Main Script ###
$files = Get-ChildItem $iisLogLocation -Recurse |
Where-Object{$_.LastWriteTime -le (Get-Date).Subtract((New-TimeSpan -Days 7))}
if ($files.Count -gt 0){
foreach ($file in $files){
$logParserArgs = @"
"SELECT LogFilename, LogRow, TO_LOCALTIME(TO_TIMESTAMP(date, time)), s-sitename, s-computername, s-ip, cs-method, cs-uri-stem, cs-uri-query, s-port, cs-username, c-ip, cs-version, cs(User-Agent), cs(Cookie), cs(Referer), cs-host, sc-status, sc-substatus, sc-win32-status, sc-bytes, cs-bytes, time-taken INTO IisLogData FROM $($file.FullName)" -o:SQL -server:.\sql01 -database:logs -ignoreIdCols:ON -fixColNames:ON -maxStrFieldLen:1000
"@
Push-Location $logParserLocation
LogParser.exe $logParserArgs
Remove-Item $file.FullName
Pop-Location
}
}