Hello,
The lookup() function acts in exactly the same way as it would usually. The purpose of dmq_usrloc is to replicate contacts between all nodes - encapsulating them inside the KDMQ messages you see being exchanged. Therefore, if a contact registers to node A and you perform a lookup on node B, the result of the lookup will be essentially the same as if it were performed on node A.
Of course, if your clients are behind NAT, then you'll probably need any outgoing messages to be routed via the node on which the client is registered. Utilising the Path-related parameters of the registrar module can help here.
The db_mode makes no difference either - dmq_usrloc interacts with the usrloc module completely independently of the storage method used. I would, however, argue that the main point of dmq_usrloc is to provide completely in-memory storage and replication, improving performance and removing the additional layer of storage/replication, so using db_mode 3 seems somewhat counterproductive.
Cheers,
Charles