You will want to check out this site... this will help - http://www.bar.ca.gov/80_BARResources/01_CAP&GoldShield/Factsheets/Website%20CAP%20FAQs.pdf
As for repairing it. You will first need a shop or someone knowledgeable to inspect what the problem is.
A+ Japanese Auto Repair, Inc.
http://www.aplusjapaneseautorepair.com/ - San Carlos Auto Repair Shop
Do you know what needs to fixed? What component needs to be changed on the car in order to bring the emissions down to a passing level?
Usually when something reaches a gross polluter, there is something that will need to be changed or adjusted in order to fix it. You will need to have someone diagnose what is wrong, what needs to be changed or adjusted. A smog shop will have to be the one who does that work.
Hope that helps!