To 'work' has been used in this sense since the early 19th century. For example, hawkers spoke about 'working a street', which meant calling on each house in an effort to sell their wares. Nowadays, 'working a room' is used - particularly in the world of show-business - to mean stopping to speak to anyone and everyone in the room you think may eventually be useful to you. Another word for the same process is 'schmoozing'.
Working the room is also used in the lapdancing trade. The girls will "work the room" going from potential client to potential client sweeping the room so every potential client has been approached. Apparently!!!!! Or so I've heard !!!!