Hello Francesco,
If you would like to write your own Octomap data interpreter, you would probably need to rewrite a fair bit of the octomap ROS package source code. I think the leaf_iterator may be a place to start?
However, if you have Navigation Toolbox, you can simply use the readOccupancyMap3D method on the message to convert to an occupancyMap3D object, which will probably be much easier to interpret and use.
-Cam

