As with SharePoint Server 2007, use Add/Remove Programs to uninstall Windows SharePoint Services 3.0 from your server. This will remove all changes to IIS but leave the log files, the web.config for Central Administration and Site Administration, and the databases, including the search database.