According this this article from 1987, every country that sends a leader to visit the president at the White House gets this treatment. The article mentions the Soviet flag flying at the White House when both Brezhnev and Gorbachev visited.
I will check this link out. I was wondering if this had been done before and if so under what circumstances. This is the first time for China though and to celebrate their founding? This does not sound like something that is traditional or right!