I would bet that this is happening because you're trying to do both in one statement. try doing the insert, then grab the identity with a second call..
cooincidentally, my first post here spoke to this issue, albeit from Win32. Identity nabber for MSSQL