If someone took a neder not to benefit from a shofar they would still be permitted to use a shofr for the mitzvah of tekiya because mitzvos lav l’henos nitnu, mitzvos are not considered a form of hana’ah. The Ritva (Sukkah 31) questions why this is so – don’t we receive the hana’ah of reward in this world or the next for every mitzvah performed? The Ritva answers that hana’ah is defined as a direct benefit received from an object; the reward for mitzvah performance is indirectly caused (gorem) by fulfillment of the mitzvah, but is not a quality of the object being used. For this same reason one is permitted to perform chalitzah with a shoe that had been used for avodah zarah, or use a mikveh that one took a neder not to have benefit from – the change in status effected by the process of chalitzah or tevilah so the women can now remarry and the person is tahor does not stem directly from the shoe or water, but is an indirect consequence of the mitzvah being fulfilled.
The gemara (Eiruvin 31) writes that whether an eiruv may be placed in a cemetery (which poses a problem of hana’ah from the dead) depends on whether an eiruv should be made only for the purpose of mitzvah-related travel, in which case we assume mitzvos lav l’henos nitnu, or even for personal enjoyment. The Avnei Miluim (28:60) asks: based on the Rtiva’s explanation, just like the personal benefit of becoming tahor or a woman being allowed to remarry is not counted as a hana’ah because these are consequences of mitzvah performance, so too, even of one gains the personal benefit of a larger area for personal travel on shabbos, since this is just a consequence of fulfilling the mitzvah of eiruv, why not apply mitzvos lav l’henos nitnu and allow the eiruv to be placed in a cemetary in all cases?