defalt answered your question in a nutshell. The solution Tor uses to hide your IP address, and nevertheless allows you to host a hidden service, is that it is the host of the hidden service that reaches out for the client through Tor circuits, so that the client or any other node never has to contact the service host directly.
This is a totally different model than what is used on "the internet", where it is the client that takes the initiative to contact the server, and hence, the contact information of the host (DNS name/IP address) must be known: with Tor, it is the server that takes the initiative to contact the client.
However, of course, the true initiative of first contact comes from the client. This is where the "rendez-vous point" is used, which is at the initiative of the client, but which is waiting for the server to reach out for it.
Tor uses a kind of 2-tier model for this. On the side of the server, the server announces its service to Tor-nodes called "introduction points". There are just random Tor relays willing to accept this job. The server contacts them through Tor circuits, so these introduction points don't know the server's address, only that an anonymous server has announced a service, and gave a public key that goes with it.
These introduction points are made public on a database (their IP addresses will be known publicly as being introduction points to this service). The server regularly contacts these introduction points to find out whether any client wants to use his services. That's the clue of this system.
When a client learns about this service and looks it up in the database, it will find the introduction points. The client now connects through a Tor circuit to another random Tor relay, which will take up the function of a Rendez-vous point. The client also connects to one of the publicly known introduction points of the service through yet another Tor circuit, to announce the desire to contact the service, and to inform about the RV point.
When the service contacts regularly its introduction points (through Tor circuits), it will find out about the client request on one of these Introduction points ; it can then contact the RV point through another Tor circuit, where both client and server are then connected through their respective Tor circuits.
As such, the client and the server always remain hidden behind Tor circuits. The introduction points are public, and the service has to poll them regularly to learn about clients desiring to contact him, and their RV points.
The RV point is the real "point of contact" between a given client and a given service but is entirely variable throughout the Tor network and has no specific relation, nor to the client, nor to the service.
At no point, any client or service gives out its IP address: they are always hidden behind Tor circuits.