I think this tutorial on tutsplus, can hel you. But i think the point if to make a class use another class, with a interface or abstract class, than can you switch at every moment, like in the example a ebook reader that can read books in pdf, epub, and another format. Valid too for example an email sender that works with mandril, phpmailer, swiftmail or another library of mails, or for example an authenthication.
If anyone think I may be wrong or can add more info, are welcome :)
PS: I think this article can give you some light. And i recomend you read about SOLID for better code
Stephen Florentino
Full StackOverflow Developer
If you look at the description on the Wikpedia article, it sounds like the principle applies to any implementation in which some of the flow control is handled by a framework which calls the code you write.
My favorite use case of this is dependency injection (DI). In this pattern, the flow control for determining where/how to get a dependency is inverted, i.e. the framework provides the dependency reference to your code as opposed to having yourself do it programmatically (by calling constructors, factory methods, etc...).