Cumulative message counts for queues can be enabled by setting the EnableMessageCounters attribute on the ServerPeer MBean declaration (messaging-service.xml in the community distro) or by invoking the enableMessageCounters method of the ServerPeer MBean from the JMX console. The output can be retrieved from the MessageCounters attribute of the same MBean or by invoking the listMessageCountersAsHTML method. The deltas in the counters are, I believe (and have been too lazy to dig-up the documentation), the difference since last access of the message counters themselves (of course, deltas are "differences," my uncertainty is the difference from "when to when").
I don't have any knowledge on how this mechanism counts messages for Topic subscriptions because I've never had to diagnose a problem with one. All of the Topics on my project are very low volume and they've never gone haywire, like JBM queues sometimes are inclined to do.