It’s a simple matter of uploading the files to the Web Part Gallery list, as shown here:
http://www.customware.net/repository/display/SharePoint/SharePoint+-+Pro…
string url_Site = sSite;
using (Microsoft.SharePoint.SPSite site = new Microsoft.SharePoint.SPSite(url_Site))
{
Microsoft.SharePoint.SPList ctg_WebParts = site.GetCatalog(Microsoft.SharePoint.SPListTemplateType.WebPartCatalog);
FileInfo file = new FileInfo(@”c:\webpartfile.webpart”);
FileStream stream = file.Open(FileMode.Open, FileAccess.Read);
SPFolder root = ctg_WebParts.RootFolder;
SPFile dwpFile = root.Files.Add(“webpartfile.webpart”, stream);
dwpFile.Update();
stream.Close();
stream.Dispose();
}