The sounds very like the Apprentice Adept series by Piers Anthony except that in those books the serfs (serfs not slaves) have to go naked not the masters.
Apart from this it all checks out. The summary given by Wikipedia is:
Apprentice Adept is a heptalogy of fantasy and science fiction novels written by English American author Piers Anthony. The series takes place on Phaze and Proton, two worlds occupying the same space in two different dimensional planes. Phaze is a lush planet of magic, where Proton is a barren mining planet of science. As the series opens, each person born on Phaze and Proton has an alternate self living on the other world. But if a person on either world lacks a duplicate (for instance if a Proton citizen immigrated there from another planet, or a counterpart from the opposite frame died), he can cross to the other through an energy "curtain" that circumscribes each frame.
The protagonist is called Stile and the robot he meets is Sheen. In the magical world Phaze the regions are called demesnes e.g. Blue Demesnes, Platinum Demesnes, and so on.