I have to implement option pricing in c++ using Markov chain Monte Carlo. Is there some paper which describes this in detail so that I can learn from there and implement?
I believe this is a nice paper for you to start with. Check out what references it cited and who cited it.
Markov Chain Monte Carlo Analysis of Option Pricing Models
"Use the Markov Chain Monte Carlo (MCMC) method to investigate a large class of continuous-time option pricing models. These include: constant-volatility, stochastic volatility, price jump-diﬀusions and volatility jump-diﬀusions. We propose a new Bayesian method for estimation and model selection, the “Mixture Model MCMC” algorithm."
Here are a few more papers about MCMC and alike methods for derivative pricing and co. :
Blanchet-Scalliet, Patras - Counterparty risk valuation for CDS
Jasra, Del Moral - Sequential Monte Carlo Methods for Option Pricing
Frey, Schmidt - Filtering and Incomplete Information in Credit Risk
Peters, Briers, Shevchenko, Doucet - Calibration and Filtering for Multi Factor Commodity Models with Seasonality, Incorporating Panel Data from Futures Contracts
Rambharat, Brockwell - SMC Pricing of American-style Options under Stochastic Volatility Models
Most of those papers are available online (mostly on Arxiv)