Create Site and Web Objects and write this code below:
SPFolder myLibrary = Web.Folders[documentLibraryName];
Boolean replaceFiles = true;
String fileName = System.IO.Path.GetFileName(fileToUpload location);
FileStream fileStream = File.OpenRead(fileToUpload location);
SPFile spfile = myLibrary.Files.Add(fileName, fileStream, replaceFiles);
myLibrary.Update();
Hope this helps.
For more SharePoint help log on to
http://blog.sharepointclick.com