For GBB pistol
Field strip and remove all dirts on moving parts with Q tips.
Then, apply a little (add what is necessary to get a smooth action, do not overlube - Balance is the key) of 100% silicone oil (It must be a 100% silicone oil : no Jigaloo, WD40, etc... - look for o-ring multi lube at your local pool store) on plastic/plastic moving parts.
White lithium grease for metal on metal contact points.
As for magazine maintenance, after each game, fill your mag with gas (do not overfill or it will wear down the seal down) and store them in a cool place (the fridge is perfect for this, do not put into the freezer) - (Keeping gas in your mag will help maintain the seal of the mag and prevent leakage - the cold temperature reduces the pressure inside the mag **PV=NRT** to a sufficent level To keep the seal from leaking).
What Gas are you using, If you are using green gas (adding silicone oil after each fill might not be necessary since some brands of green gas have silicone oil added to the gas mixture); if you are using propane, it is highly recommended to add 1.5 WT 100% pure silicone oil in the propane adapter for every 6-8 mag fills to help lubricate the magazine seal as well as the GBB itself.
As for GBB rifles, I guess you could just do the same but I am no GBBr expert.