So pkm is the byte array containing the PKM data and 0x38 is the offset for the IVs, right? This is the syntax for BitConverter.ToUInt32:
'Declaration
<CLSCompliantAttribute(False)> _
Public Shared Function ToUInt16 ( _
[b]value[/b] As Byte(), _
[b]startIndex[/b] As Integer _
) As UShort
This is what you are doing:
UInt32 Stats = BitConverter.ToUInt32([b]ARRAY[/b], ([b]startIndex[/b] << 0));
See the problem yet? You're shifting the index, not the value at that index. You need to fix your parentheses, I think:
UInt32 Stats = BitConverter.ToUInt32(pkm, 0x38) << 0);
You do realize [0-31] is the range of values, right? That doesn't go in your code.