Available in the LEADTOOLS Imaging toolkit.
HistoEqualize example for C++ 5.0 and later
This example equalizes the bitmap's histogram and repaints the image.
m_Lead1.HistoEqualize(YUV_SPACE);