"In Vain" by Emily Dickinson gives two examples of use:
If I can stop one heart from breaking,
I shall not live in vain;
If I can ease one life the aching,
Or cool one pain,
Or help one fainting robin
Unto his nest again,
I shall not live in vain.
Aesop's fable "The Fox and the Grapes" gives another:
A hungry fox saw some fine bunches of grapes hanging from a vine that was trained along a high trellis, and did his best to reach them by jumping as high as he could into the air. But it was all in vain, for they were just out of reach: so he gave up trying, and walked away with an air of dignity and unconcern, remarking, "I thought those grapes were ripe, but I see now they are quite sour."