There does not seem to exist sample code for C# (yet) however there is some sample C++ code that demonstrates what you want:
void Samples::RsaEncryptDecrypt()
{
Announce("RsaEncryptDecrypt");
// This sample demostrates the use of the TPM for RSA operations.
// We will make a key in the "null hierarchy".
TPMT_PUBLIC primTempl(TPM_ALG_ID::SHA1,
TPMA_OBJECT::decrypt | TPMA_OBJECT::userWithAuth | TPMA_OBJECT::sensitiveDataOrigin,
null, // No policy
TPMS_RSA_PARMS(null, TPMS_SCHEME_OAEP(TPM_ALG_ID::SHA1), 2048, 65537),
TPM2B_PUBLIC_KEY_RSA());
// Create the key
auto storagePrimary = tpm.CreatePrimary(TPM_RH_NULL, null, primTempl, null, null);
TPM_HANDLE& keyHandle = storagePrimary.handle;
ByteVec dataToEncrypt = TPM_HASH::FromHashOfString(TPM_ALG_ID::SHA1, "secret");
cout << "Data to encrypt: " << dataToEncrypt << endl;
auto enc = tpm.RSA_Encrypt(keyHandle, dataToEncrypt, TPMS_NULL_ASYM_SCHEME(), null);
cout << "RSA-encrypted data: " << enc << endl;
auto dec = tpm.RSA_Decrypt(keyHandle, enc, TPMS_NULL_ASYM_SCHEME(), null);
cout << "decrypted data: " << dec << endl;
if (dec == dataToEncrypt)
cout << "Decryption worked" << endl;
_ASSERT(dataToEncrypt == dec);
// Now encrypt using TSS.C++ library functions
ByteVec mySecret = tpm._GetRandLocal(20);
enc = storagePrimary.outPublic.Encrypt(mySecret, null);
dec = tpm.RSA_Decrypt(keyHandle, enc, TPMS_NULL_ASYM_SCHEME(), null);
cout << "My secret: " << mySecret << endl;
cout << "My decrypted secret: " << dec << endl;
_ASSERT(mySecret == dec);
// Now with padding
ByteVec pad { 1, 2, 3, 4, 5, 6, 0 };
enc = storagePrimary.outPublic.Encrypt(mySecret, pad);
dec = tpm.RSA_Decrypt(keyHandle, enc, TPMS_NULL_ASYM_SCHEME(), pad);
cout << "My secret: " << mySecret << endl;
cout << "My decrypted secret: " << dec << endl;
_ASSERT(mySecret == dec);
tpm.FlushContext(keyHandle);
} // RsaEncryptDecrypt()
Of course instead of creating a new primary key you would probably want to use the SRK or a child key.