lMyLongValue = command.executeScalar;
This will set your variable to the the return value of the stored procedure.
Your stored procedure will include something like this:
DECLARE @ReturnValue AS INTEGER
INSERT INTO xTABLE....
SET @ReturnValue = @@IdentitySELECT @ReturnValue
Post your code and I'll give you hand if needed.
Good Luck