How to decrypt a PGP message with only the two primes and the public exponent?
Look up the OpenPGP secret key format (some kind of ASN.1 I think?).
Use your favourite bignum implementation to multiply p by q and store this as the modulus n (in the correct format).
To calculate the decryption exponent, you need $d$ such that $ed=1 \pmod{(p-1)(q-1)}$. This can be found with the extended Euclidean algorithm (the wikipedia pages for RSA and the Euclidean algorithm explain the details) - you're probably going to end up implementing this in your favourite bignum library too.
Store $d$ in the secret key file you're building, import it into gnupg and decrypt normally.


Depending on what programming languages you know, there may be shortcuts - instead of building a key file you might be able to build a key data structure directly and use your language's gnupg/libgcrypt wrapper to work with that.