The easiest way to do this programmatically (using ADSI and VBScript) would be to use adsutil.vbs (installed by default in the C:\InetPub\AdminScripts folder) to modify the relevant configuration options in the metabase. You can find more about the IIS 6 version of the script here...
Because logging can be set at a number of levels, I'd suggest using the following to find all the locations of the LogType property:
cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs FIND LogType
Then you can iterate through each to document the current values, for example, for website n:
cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs GET /LM/W3SVC/n
And finally—what you're looking for—here's an example to disable logging on website n by setting the value to zero (you'll want to iterate through all of the nodes found, because child node settings always override inherited parent settings):
cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET /LM/W3SVC/n
All of the above commands can also be appended with
-s:SERVERNAME to perform the command against a server other than localhost.
There are a number of alternative methods of modifying the metabase, including (but not limited to) using ADSI through another language, WMI, or direct XML manipulation. Please also note that that these instructions are valid for IIS versions 4, 5, 5.1 and 6. Version 7 is slightly different, but with the optional IIS 6 compatibility components installed, these instructions would be valid on IIS 7.0 and 7.5 as well.