You can attach to running service from visual studio as Timo Geusch suggests. After that you can set a breakpoint in your code. You also can add call to DebugBreak function in the place you want to debug your library. This can help you if the code you want to debug is executed before you can attach to process (if your code executed in handler of service start event for example).
EDIT: You can attach to any service, even if you don't have debugging information for it, but in this case you wouldn't be able to see stack trace above your function call.