Characteristic classes of flat bundles