Open it up and remove the battery, making sure everything is dry as a bone. [http://www.ifixit.com/Device/DualShock_3#deviceGuides|Dualshock Repair guides]
While in there check for corrosion/rust if any is present, depending on how extensive it is, try removing it if you can using a light touch.
All of this assumes that the controller was not powered on while submerged, if it was you may be out a controller as the motherboard may already be fried. If you're lucky it may only be the battery thats dead.