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
Check this document out: link to pdf file
Also, if you are concerned with actual performance of your code and want to implement efficient code then gsl libraries would be the first place look at: link. It's got everything you need.
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)