You create an IMapping object by calling the IMappings.Add method, as in the following example, where objMapping is the name you give to the IMapping object:
Option Explicit
On Error Resume Next
Dim objSearchAdmin, objBuildServer, objCatalogs, objCatalog, objMappings, objMapping
Set objSearchAdmin = CreateObject("Search.SearchAdmin.1")
Set objBuildServer = objSearchAdmin.BuildServer
Set objCatalogs = objBuildServer.BuildCatalogs
Set objCatalog = objCatalogs("KMSampleCatalog2")
Set objMappings = objCatalog.objMappings
Set objMapping = objMappings.Add "C:\InetPub\wwwroot",
"http://www.microsoft.com"
'Release objects
Set objMapping = Nothing
Set objMappings = Nothing
Set objCatalog = Nothing
Set objCatalogs = Nothing
Set objBuildServer = Nothing
Set objSearchAdmin = Nothing