The extension ToBytes provided in SnmpDataExtension does this, but it apparently includes the data-type bytes too. For instance, for an IPAddress datatype it returns 6 bytes instead of 4.
It would be nice if ISnmpData interface expose a function like GetRaw to let the user access the underyling raw bytes without type.