Yes, it is mostly a literary expression. It is rarely used in the spoken language.

Не... ли is used to express hypothetical actions and polite requests/questions. Не here does not mean the negation, but makes emphasis on uncertainty and unreliability.
Не... ли is "more hypothetical" than just plain ли.

While "Мы ждали, что ты приедешь вечером." is "We waited for you to come in the evening.",
"Мы ждали, не приедешь ли ты вечером." is more like "Мы надеялись, что ты приедешь вечером." - We hoped that...

I'm not sure what is grammatical difference between не... ли and plain ли, but they are not grammatically interchangeable:
"Мы ждали, не приедешь ли ты вечером." is OK, and "Мы ждали, приедешь ли ты вечером." looks ungramatical to me.
"Мы размышляли, приедешь ли ты вечером." is OK, but "Мы размышляли, не приедешь ли ты вечером." sounds weird.

Also, "Приедешь ли ты завтра?" is just a questions (sounds old-fashioned, though; we almost never use ли in yes-no questions in the modern language), and "Не приедешь ли ты завтра?" is a polite request.

In the colloquial language you can hear such set expressions as "Нет ли у вас...", "Не найдётся ли у вас..." in the meaning "Не могли бы вы дать/занять мне..."