This is how you create a document library with C# in a farm solution:
Guid myListID;
myListID = myWeb.Lists.Add("LibraryName", "Library Description", SPListTemplateType.DocumentLibrary);
myWeb.Update();
It's pretty easy and mostly self explanatory. I placed this in an event receiver so that I can create document libraries on feature activation. Works pretty good.