Does your program perform the same setup/initialization as the program that works?
Starting with version 10, you have to do some additional initialization before you can use ArcObjects. If you look at the help it is described there.
If it isn't initialization then the only other thing that I can think of is permissions. For example, make sure that no other process has the file locked and that you have the required permissions.