What does the whole part in bold say?
It's just saying what Harry is imagining.
You could break it down like this:
... for a moment Harry imagined
- coming here with Dumbledore,
- of what a bond that (=coming here with Dumbledore) would have been,
- of how much it (=coming here with Dumbledore) would have meant to him.
So, Harry "and Dumbledore both had deep roots in this graveyard." Harry is thinking that Dumbledore should have told him about this. But Dumbledore "never thought to share the connection."
Had Dumbledore shared this with [connection] Harry, "they could have visited the place together."
Harry is imagining what it would have been like if they both visited the place together. Harry is imagining that if they did visit the place together, he and Dumbledore would have a stronger bond (or great bonding moments), and that visiting the place with Dumbledore would mean so much to him (= Harry).
Edit: I don't think "imagined of" is common usage - I can't find reliable usage examples from google books/news. I think it might have something to do with how we use "of" with "think" (e.g., I was thinking of the old days, of how high I used to be able to jump, of how quick I was).
How about removing "of":
"... for a moment Harry imagined coming here with Dumbledore, what a bond that would have been, how much it would have meant to him."
Does it sound right? - dan (from comments)
I thought of this. The thing is, for me, if you remove "of", the second element/thought seems to lose clarity. Removing "of" makes it hard to tell if the second element/thought is still part of Harry's imagination, or if it is what the "close third person narrator" is imagining/narrating.