We explored the B-C-O system at pressures in the range 0-50 GPa by ab initio variable-composition evolutionary simulations in the hope of discovering new stable superhard materials. A new tetragonal thermodynamically stable phase B4CO4, space group I4, and two low-enthalpy metastable compounds (B6C2O5, B2CO2) have been discovered. Computed phonons and elastic constants show that these structures are dynamically and mechanically stable both at high pressure and zero pressure. B4CO4 is thermodynamically stable at pressures above 23 GPa, but should remain metastable under ambient conditions. Its computed hardness is about 38-41 GPa, which suggests that B4CO4 is potentially superhard.