If you want random bytes and you want to minimize the amount of cryptography implementation you need to write or change then using a hash function with a secret key is the easiest way.
If you want a full API with all the features provided by ordinary insecure RNGs then you will need to modify that high level code, extend an RNG class, or implement your own.
You can generate random bytes using
hash(key || counter++) where hash is a cryptographic hash (SHA-512, etc.),
|| means concatenation of byte strings, and
counter is has enough bits to prevent repeat output.
hmac(key, counter++) also works.
If you want back tracking resistance (state getting leaked doesn't let someone calculate past output) then use something like
output = hash(input);
input = hash(input || counter++);
input to be a random value.
If you have a "fast key erasure" implementation available then I instead recommend that.
It is also possible to create PRNGs based on other cryptographic algorithms but primitives other than hashes require a bit more knowledge to use correctly.