If the thing being passed in can't be determined at the point of creation, you need some form of Abstract Factory, though it is generally useful to draw the line between Services and Value Types that shouldnt have backreferences to to Services.
Why am I answering in generalities? Because you ask in generalities - please give an example of something more concrete and contextual you're looking for a good approach to if you really want to get an answer that's going to be useful.
You haven't specified whether you're looking at the Dependency Inversion Principle or DI Frameworks or Dependency management in libraries, which have as much in common and much to set them apart.
I suspect that (even though you don't seem to touch .NET tags), as @TrueWill has recommended, the excellent Dependency Injection in .NET book will help you to understand the subtleties involved (regardless of what language or platform you're using - the front of the book is just pretty technology independent patterns - to the degree that this is possible given that the excellent examples have realistic complexity levels means).