"With flying colours" means with great success, to do something really well.
I would say the most common usage relates to exams or tests. If someone does really well on a test, you can say they "passed with flying colours".
I'm not sure of the origin, but my guess is it relates to parades or ceremonial processions which often would use multicolored flags or banners "flying" in the air.