EDIT 2:
// Answer for newest question (V2) //
You need to cast the object to an int for example
int iResults = (int)cmd.ExecuteScalar();
should do the trick
// Answer for first question before edit //
this code
Dim hashedBytes As Byte()
in C# would be
byte[] hashedBytes;
EDIT:
You would then of course need to initialize the array. For example
byte[] hashedBytes = new byte[128];