To gain confidence in your ability to act in an emergency,
practice this and all other BCD breathing skills
with your gear in shallow, calm water. Be sure to disinfect
your BCD first.
Clear your mouthpiece. Tom Phillipp, Aqua
  Lung’s product manager for BCDs, points out that
  many oral inflators have holes behind the deflator button
  to prevent water from being blown back into the
  bag while purging, so the best method is to first blow a
  little air in so the water runs out the holes. Then hold
  the deflator valve down as you continue blowing. Your
  exhaled breath will now go into the BCD, and the holes
  will be sealed so no water can re-enter.
Bret Gilliam prefers to raise the inflator overhead,
  then put the mouthpiece in while rolling to the right to
  let as much water as possible slide down the hose before
  inhaling. He notes that even after the diver purges the
  mouthpiece, it’s still likely that he’ll get 10 to 20 milliliters
  of water with his first breath. This problem would be
  less severe if the diver used his shoulder or back-mounted
  dump valve to vent; water would still enter the BCD
  but not the hose, and would settle to the lowest part of
  the flotation bladder.
Once you’ve begun getting air from your BCD, don’t
  release your tight hold or water will leak in through the
  holes. With older models, bend the mouthpiece up, seal
  your mouth, look down and, as before, blow air in as
  you push the valve. The water will flow from the mouthpiece
  and become trapped in the hose, but air will be
  able to get past it.
Take your first breath cautiously. Inhale slowly and
  carefully, as you would with a wet snorkel, trying to catch
  the moisture on your tongue. Then try to swallow the
  water. If you do cough or gag on a few droplets, don’t
remove the mouthpiece, just cough into the BCD. 
Control your ascent. Exhale normally and watch your
  ascent rate. You still face the danger of an embolism if
  you retain air breathed at ambient pressure. Don’t let go
  of the valve or remove the mouthpiece from your mouth
  as you ascend. If you are rising faster than your bubbles,
  exhale through your nose. Flaring out horizontally will
  also help slow your ascent.  
Use air from your tank. As long as your power
  inflator is working, you can add more fresh air to your
  BCD as you rise, and you can continue to breathe it at
  ambient pressure. Keep the mouthpiece valve closed
  tightly while putting air into your BCD so none escapes.
  Press your power inflator intermittently, take a breath
  and exhale it through your nose to insure a continuous
  supply of fresh air. You can also breathe from your BCD
  while a buddy is breathing from your tank. Since your
  power inflator bypasses your regulator’s second stage,
  you can inhale from the BCD at any time without overbreathing.
  If your buddy is in danger of over-breathing
  the second stage you’ve shared with him, wait to feed air
  into the BCD until you see his bubbles. Keep feeding air
intermittently between your buddy’s inhalations. 
When no air is available from your tank. Air in
  your BCD will expand as you rise just as air in your tank
  does, allowing additional breaths as ambient pressure
  decreases. Start up immediately, keep trying to inhale
  and exhale, and air will become available. If you have
  a BCD-mounted safe second such as the Air 2, you can
  access the air in your BCD by pressing the deflate button
  when inhaling. In one study, basic scuba students were
  able to rebreathe this way for a full minute with no problems.
  Stay relaxed because rising CO2 levels will cause
  you to breathe faster and faster, which could lead to a
  sudden blackout.
Sound complicated? The industry obviously thinks
  so. Still, although no one’s making you learn these new
  skills, one day you might be glad you or your buddy did.