I have a large library of books and DVDs and I would like some way to keep track of what I have and what I have loaned out to friends.
You can use OpenDB. You would need to host it yourself, but it should be easy to get running on any basic Apache+PHP capable computer. GoDaddy also offers it as an installable application on their hosting plans.
If you're comfortable using a site just for books, I've always loved LibraryThing.com. They also have a tagging mechanism that I've used to keep track of books that are loaned out - e.g. tag them "loaned out" and "loaned to X" and then you can easily look at all books in the "loaned out" tag and see who has them.
Disclosure: I work at Ragic
You can try to build one yourself with Ragic. Just create data forms like you would on Excel or other types of spreadsheets, and it becomes an online database for you to enter and search for records.
On the books side of your question. I'd strongly suggest Goodreads.
I used LibraryThing for a while but the site design is not great (a bit unintuitive) so I switched to Goodreads after it was voted top of Lifehacker's Hive Five and have been very pleased with it so far.
Flickchart keeps track of the movies you've seen and the movies you haven't seen by way of giving you movie matchups to rank your taste in movies over time. After ranking films for a while. it will also tell you exactly how many films you've seen in your lifetime, and how much of your life you've spent watching movies.
You should really give a chance to Moviez.4pu . It's very statistical. You can see which of the IMDB top 250 you own/saw (The list is updated weekly). Also stuff like what's your favorite horror movie, who is your favorite actor and much much more.
Organize your Movie/TV, Music, Game or Book collections.
List your owned, watched, read or played items and share with friends.
BillMonk does exactly that. It also allows you to split bills with your friends and keeps track of everything.
For books… http://readernaut.com/