I believe the appropriate rule references are 4-10 which defines Closely Guarded, 4-23 which defines Guarding, and 9-10 which describes the violation for Closely Guarded.
I don't think there is any dispute that the count stops when the guarded player loses control of the ball (interrupted dribble, ball batted away, etc.) and when there is no defender within six feet of the player in control of the ball. The count also stops when a closely guarded player who is dribbling ends the dribble or when a closely guarded player who is holding the ball begins a dribble. I believe there is now reasonable agreement that if an offensive player sets a screen and is between the player in control of the ball and the player attempting to guard him, then the five second count should be stopped. Also, by NFHS rules, it need not be the same player doing the guarding for the entire five seconds. If A1 dribbled with B1 guarding him and then A1 moved and B2 was guarding him (and B1 no longer was) and one of them was within six feet during that time, then the count continues.
The definition and interpretation of guarding as it applies to the five second count is what can be controversial, particularly the language in 4-23-1 that reads "in the path of the offensive opponent." The book does not exactly define what that phrase means. Many use the "head and shoulders past he torso" as a guide, but some do not.
Here is a link to a thread that covers some of those topics.
http://www.officialforum.com/thread/10518