Find number X by asking Hamming distance between X and Y in binary representation
One reasonable heuristic would be to use a greedy algorithm, which at each step picks a query that is likely to reduce the space of possibilities as much as possible.

Suppose you care about the maximum number of questions (worst-case).  Then I suggest the following strategy.  At any point, you have a set $S$ of possible values of $X$ that remain.  For each possible query $Y$ and each possible response $R$ to that query, let $n(Y,R)$ denote how many possibilities of $S$ would remain consistent with the response $R$ to query $Y$.  Define $n(Y) = \max_R n(Y,R)$.  Now, choose the query $Y$ that makes $n(Y)$ as small as possible.  [This is basically Knuth's minimax algorithm.]

Alternatively, suppose you care about the expected number of questions asked (average-case).  Then do the same, except now define $h(Y)$ to be the entropy of a random variable that takes on the value $R$ with probability $n(Y,R) / |S|$.  In other words, define

$$h(Y) = - \sum_R {n(Y,R) \over |S|} \lg {n(Y,R) \over |S|}.$$

Then choose the query $Y$ that minimizes $h(Y)$.

There is no guarantee that these procedures are optimal, but I bet they're pretty good.

Related but not the same: you might also be interested in Ulam's game, a generalization of the game of 20 questions.  Also, take a look at this post, which describes an algorithm for 20 questions based on entropy calculations.