I agree with justalayman that some rights-protected material comes with greater legal risk for any writer wishing to use them. The Harry Potter material must be handled with extreme care so that your use does not infringe on the author's rights. She is vigilant when seeking out infringers and she is not shy about sending cease and desists with threats of lawsuits to those who use her work without permission.
On the whole, however, the use of trademarks in a fictional work will hold less legal risk for a writer than the unauthorized use of another's copyrighted material. You are allowed to use trademarks in a descriptive sense (ie, a character can drink a Slurpee from 7-Eleven or drive a Ford Focus). The major area of concern with trademarks is using a trademark in such a way that it is likely to confuse consumers into thinking the trademark holder is connected in any way with your work (endorses it, sponsors it). Another area of concern is trademark "disparagement," where the depiction of the trademarked product or service is an unflattering or false one.
As to how much copyrighted material you can use without running into infringement problems, there is no pat answer to that question. "Too much" is however much a copyright holder thinks is too much. The best way to avoid infringement is to seek permission from the rights holder if you wish to use a portion of their material in your work. Some will probably say no, some will probably say yes. For those who object to your use of their material, the smartest thing to do is not use it. Find an alternative. If your use of the material is key to your novel, make sure your work is reviewed carefully prior to publication by a publishing law expert and then make sure you have insurance enough to cover your work should it spawn a lawsuit.
Here are some resources for you to check out that you may find helpful:
The Society of Children's Book Writers and Illustrators
http://www.scbwi.org - this site has a forum
Association of Authors' Representatives
http://www.aaronline.org - a professional organization for literary agents
The Authors Guild
http://www.authorsguild.org - for already-published authors
The United States Copyright Office
http://www.copyright.gov
The United States Patent and Trademark Office
http://www.uspto.gov
Although nothing can
prevent a lawsuit, your goal should be to minimize as much as possible the risk of one arising from your writing. Publishing houses will generally have editors and attorneys on staff to review manuscripts and assist in pointing out, editing or deleting the parts in a work that can attract a lawsuit. You can also contact an Intellectual Property attorney, a publishing law attorney or a business attorney with publishing law experience to review your work prior to publication.
Ideas, by the way, cannot be copyrighted, so anyone who hears your idea can take it and run with it. The only way to prevent that from happening is to not disclose your idea to anyone. It will be your
expression of the idea (the fleshing out of the idea) when fixed in a tangible form that has protection under copyright law.
With that said, you may wish to edit the idea for your novel out of your original post.
It is an excellent idea, by the way. I wish you literary success.