In order to prevent anyone other than the TM owner from using the mark, it requires Federal registration. See,
http://www.uspto.gov/trademarks/basics/index.jsp
Just because a mark is registered, does not mean that no one can make reference to the mark, of course. "I had a bad meal at McDonald's today..." could not be a violation. If however you opened up a restaurant and decided to call it McDonalds, there would be a violation: 1) use of the mark (or confusingly similar); 2) in the same class as a registered mark (food) there would be prima facie violation. However, it is up to the TM owner to contact the violator (cease and decist letter first, then sue for damages).
Millions of "violations" of TM happen every day, but in most cases the TM owners do no t rigorously enforce. But the big ones do. Try using IBM, or Google or Merck in a way that appropriates and expect a cease and decist letter in a hurry. Many big companies have one or more monitors (usually work in General Counsel's office and are trained as paralegals and librarians) who scan the market for violations of their marks.
A full description of TM law and practice would require 500 pages and a semester class offered in most law schools. However here's hoping this quick and dirty explanation helps.
Oh, by the way the Feds and the courts do not treat the internet differently from any other place "in commerce" ... so TM violations (or not) in the street or on the net are the same for legal purposes.
19Trees