You have to compile your shared library A first and install to a location contained in your path (/usr/local/lib for example). From that point on build your application using shared library A. Your application doesn't need to know that one of it's libraries uses other libraries as well.
I'm not sure, but I think that 'ldd' will reveal anyway all dependencies, so library B might show up on the list as well.
Is this needed for some workaround due to licensing issues, or is the client not supposed to know that parts of the code are using some external code?