Here is a tutorial on how to perform such a k-means modification:
http://elki.dbs.ifi.lmu.de/wiki/Tutorial/SameSizeKMeans
It's not exactly what you need, but a closer k-means variant that can be easily adapted to your needs. Plus, it is a walkthrough tutorial.