A couple of comments: First you should restrict to coherent D-modules to get the duality functor (on the derived level). Next I think the notation is a little off from the standard. The easy D-module pullback functor is usually the one denoted with a dagger, while its shifted version is $f^!$, not $f^\ast$ - which is its dual. These conventions are set up so as to have the "formalism of six operations" -- i.e. we have adjoint pairs $(f^\ast,f_\ast)$ and $(f_!,f^!)$ for general morphisms (on coherent holonomic D-modules), related by duality. The two pushforwards agree for proper maps and the two pullbacks agree (after dimension shift) for smooth maps.
A couple of comments: First you should restrict to coherent D-modules to get the duality functor (on the derived level). Next I think the notation is a little off from the standard. The easy D-module pullback functor is usually the one denoted with a dagger, while its shifted version is $f^!$, not $f^\ast$ - which is its dual. These conventions are set up so as to have the "formalism of six operations" -- i.e. we have adjoint pairs $(f^\ast,f_\ast)$ and $(f_!,f^!)$ for general morphisms (on coherent D-modules), related by duality. The two pushforwards agree for proper maps and the two pullbacks agree (after dimension shift) for smooth maps.