I don't think you want to be using the TO_DAYS() function. That returns the number of days since year 0. What you should try to use is the DATE_ADD() function. The syntax looks like "DATE_ADD(date,INTERVAL expr type)".
For your example it would work like
$query = "SELECT date FROM calendar WHERE [B]date >= NOW() and date <= DATE_ADD(NOW(), INTERVAL 30 DAYS)[/B]";
or using BETWEEN would look like
$query = "SELECT date FROM calendar WHERE [B]date BETWEEN NOW() and DATE_ADD(NOW(), INTERVAL 30 DAYS)[/B]";
both should give the same result.
So any value in your "date" column that is between NOW() (inclusive) and 30 days from NOW() (inclusive) will be returned.