Let us recap the problem: 6 Clubs, with the Queen of hearts lead.
Counting the 7 tricks in the club suit, you have 11 top tricks (1 Spade, 2 Hearts, 1 Diamond, 7 clubs). The only hope for a 12th trick is a squeeze. The lead indicates that the 10 of hearts is guarded solely by West, i.e., it is correctly positioned for a squeeze (West has to pitch before North). If West has the KQ of spades too, you can catch him in a squeeze-and-endplay, reaching this position;
West has to keep 2 hearts (else his Jack will fall under the King), and so he must keep only 1 spade. Now he is ripe for an endplay. You lead your spade, and he yields the 12th trick by his heart return. The only possible snag is that he may try to fool you, unguarding the heart Jack and keeping 2 spades (pitching one honor, keeping a small one). But you will play him to have started with 6 spades, given the bidding, and so you will only have problems if he had 7 spades originally (a very unlikely holding).
Well, what if West does not have KQ in spades? After all, he did not lead a spade. The ending above does not work if East has a spade honor. West can unblock in spades and you are down (when East wins the spade trick, he can play anything and you will never make 2 tricks).
You have to look for a line of play that will deal with Hx in East, given the bidding and the non-spade lead. Follow the solution closely: win the heart lead in your hand, play the Ace of diamonds, and ruff a diamond. Cash the Ace of clubs (West shows void), and finish drawing trumps, while ruffing your 3rd diamond. You are now looking at these cards:
Now your plan faces a bifurcation, depending on how East will react when you play your next spade to the Ace, to ruff the last diamond. If East (with presumed Hx) plays an honor, you will win, ruff a diamond, and try to reach the ending shown earlier (i.e. you will endplay West with his remaining spade honor at the 3-card ending). If East plays low, you will have to play for some other ending. Win the Ace, and ruff a diamond (you will need diamonds 4-4 in this variation), to reach the following ending, with open cards since you are already visualizing the opponents' hands as this:
When you cash dummy's last trump, East must pitch a heart (else you reach that first ending). Now, you pitch a heart from dummy! What can West do? If he discards a spade, you play your spade, and dummy is good. He will probably discard a heart. Now your 10 of hearts is established, but you don't have an entry to it. Or do you? Play a heart to your King, and lead a spade. What can they do? Either West plays the King and loses the last spade trick to your Jack, or he ducks the spade to East's queen, and East has to lead his heart, letting you finally win that elusive 12th trick with the 10 of hearts. This is what is known in the literature as a stepping-stone ending.
Isn't it gorgeous?