This seemed to me an interesting question and I certainly sympathize with Baba's implicit assertion that the concept of the two "Houses" is a fundamentalist innovation: certainly, as far as I can tell, there is no direct reference to it in the Qu'ran, the Hadith, or the Sunnah.
However, after some research, I have discovered that it is indeed a "classical" Islamic formulation, i.e., it dates from an early period in Islamic history -- specifically from the eighth century, with commentary extending all the way to the twelfth century, essentially encompassing the golden years of the Abbasid Caliphate.
According to the source I consulted (recommended to me by a professor of Islamic Studies at the university where I teach, since I am far from being an expert) the "Two Houses" formulation can be included in that body of commentary known as the Siyar. It was developed by prominent Islamic jurists to deal with the various contingencies raised by the realities of imperial rule and was intended to provide a guide (using the Qu'ran, the Hadith, and the Sunnah as primary sources) to the conduct of international relations. According to my source (I provide the reference below), since the Siyar is based on the above sacred texts/sources, it can be considered "an extension of the Shari'ah, or Divine Law."(1)
The Muslim jurist who first used the term Siyar was the well-known Abu Hanifa (who did, apparently, comment on the theory of the "Two Houses" in the eighth century), but it was one of his students, Muhammad ibn al-Hasan who wrote on it "extensively and systematically." A famous commentary was later also written by Shams al-Din Muhammad ibn Ahmad Sarakhsi.(2)
(1)Ralph H. Salmi, Cesar Adib Majul, and George K Tanham, Islam and Conflict Resolution: Theories and Practices (Lanham, MD: University Press of America, 1998), 66.
(2) Ibid.
Bookmarks