For example (in Los Altos, CA), I contacted Comcast via online chat and was given the following procedure to replace the modem. The procedure varies geographically, I imagine; so start by contacting Comcast. But this gives you an idea what to expect.
Turn off the computer to which the old modem is connected. Disconnect the old cable modem, connect the new one in its place and then turn on the computer. Open Internet Explorer (or whatever browser you use) and enter the address http://sas.r2.attbi.com Enter your Comcast account number (from your cable TV bill), and your Registration number (that is the last 9 Digits of the account number). Go through the menu and choose Replace Equipment. Once you are done registering the new modem you should be asked to power down and power up the modem. The next time you turn on the PC the new modem should enable you to connect to the Internet.
The old rented modem can be returned to your local Comcast payment center. To find it, direct your browser to http://www.comcast.com and click on the Payment Center link. They will give you a receipt for the returned equipment, and will also adjust your bill to show that you are no longer renting.