What you are describing is a classic application of Aspect-Oriented Programming (AOP). Depending on which language and framework you are using, there are AOP frameworks and containers whose sole function is to intercept DLL calls in the manner you describe, allowing you to perform some operation before or after the DLL call.
The canonical example is logging. Logging can potentially occur anywhere in your program, and writing code for each and every DLL call so that it can be logged gets dull in a hurry. But with an AOP framework, you can simply attach all of the DLL entry points at once, and have them each call a single logging function. This can be done in a number of different ways. Some AOP frameworks do it with method attributes. Others inject code into the DLL.
Aspect-Oriented programming is all about handling cross-cutting concerns.
See Also:
http://en.wikipedia.org/wiki/Aspect-oriented_programming