If the library requires check-out for editing documents then your code should upload the document without checking it in if you set the last parameter to False.
If the library does not require check-out for editing documents or you pass True for the last parameter then your code will automatically check-in the file after uploading.
If it's acceptable in your case change the library's versioning settings to require check-out and upload the documents with your code by passing False for the last parameter.
Library.RootFolder.Files.Add(fileName, buffer, false);
That's how I do that in one of my tools. The tool is for 2010 but should be the same behaviour for 2007.
For SP 2010, SP 2013:
If there are required fields in the list then you can use SPFileCollectionAddParameters as below
System.IO.FileStream fileStream = null;
Byte fileContent = null;
string filePath = @"C:\.....\TestFile.docx";
string fileName = "TestFile1";
SPList lib = web.Lists["ListName"];
fileStream = System.IO.File.OpenRead(filePath);
fileContent = new byte[Convert.ToInt32(fileStream.Length)];
fileStream.Read(fileContent, 0, Convert.ToInt32(fileStream.Length));
SPFileCollectionAddParameters parameters = new SPFileCollectionAddParameters();
parameters.AutoCheckoutOnInvalidData = true;
parameters.CheckRequiredFields = true;
SPFile uploadedFile = library.RootFolder.Files.Add(lib.RootFolder.Url + "/" + fileName, fileContent, parameters);
Just tested and it works. If you don't have required fields then the file will be checked in automatically but that also happens when adding new documents using the UI.
UI doesn't check in the document automatically only if there are required fields.
I think OOTB functionality of adding documents is using SPFileCollectionAddParameters too because the behaviour is the same.
For MOSS 2007 there is no SPFileCollectionAddParameters. There are other overloads of SPFileCollection.Add that have bool parameter checkRequiredFields. (not tested)