Bomb hits northwestern Pakistan; at least 30 killed