To expand a bit on what's been said so far, either to or for are equally used in this context and are both correct. With the exact wording you have here, I think to is the better option.
As for the actual distinction, it's a little fuzzy. Worded like this, the difference is that to indicates where/what you are being invited to, while for indicates the reason.
He invited me to dinner at 9pm.
This specifies what the invitation is for and tells you what the speaker is being invited to.
He invited me [over/out] for dinner at 9pm.
Although you'd be understood without the addition of the words "over" or "out" this makes it a little more clear. You've been invited over to his house or out to a restaurant, and the reason is to share dinner.
The reason you can use them interchangeably in this context is that dinner is both an event one can receive an invitation to, and an activity one can be invited over for.
Just to complicate matters a little, to can also be used to refer to intended actions or reasoning, as I mentioned for could in the previous example.
He invited me over to help fix his stove.
vs.
He invited me over for help fixing his stove.
Notice that when I used to it's referencing a verb (to help fix...). However, I chose for when I was referencing a noun (for help...).
It is confusing, and most native speakers will have trouble pinning down the actual rule of when they use one or the other. Your best bet is just to keep listening to sentences that use it until one starts to sound right. But, when it comes to dinner specifically, either is fine.
"Using" is a participle, but it is an unusual participle in that "using" frequently acts like a preposition.
"I fought him using a sword" means the same as any of the following.
"I fought him with a sword." We clearly would classify ""with" as a preposition.
"Using a sword, I fought him." We would classify "using" as a participle used as an adjective modifying "I." This construction is grammatical, but not usual.
"I fought him by using a sword." We would classify "using" as a participle used as a gerund. This latter form, I suspect, has created by ellipsis the locution of "using" as a quasi-preposition. And that phrase is adverbial in function by describing how the subject fought.
Best Answer
Nope! In all three of the sentences at the end of your question, by indicates location: beside, near, next to, nearby (though the meaning could be shifted by context). To indicate that the pen, the tumbler, or the bowl were the means, you would need another word:
Most common prepositions in English are best understood as elements of phrases, where the phrase as a whole has the meaning, not the preposition by itself independently of a phrase. The dictionary definition of a preposition can often help you figure out the meaning of a given phrase that you came across, but they're not much help for constructing your own sentences with (not "by") the same preposition.
This might make learning English prepositions seem hopeless. I do think that English prepositions are even more complicated than English spelling. Together with this long answer, though, the following might help. Instead of trying to explain what by "means", the examples below show, starting from a specific means or method, how you express it in a prepositional phrase modifying the verb. Sometimes the preposition will be by, and sometimes it will be something else. Of course this doesn't explain all kinds of expressions for means and methods; these just show you how expressing these (and many other) ideas works in English.
Some means and how to express them
To indicate the tool that is operated to perform the action of the verb, you say with:
To indicate the light that provides visibility for the action of the verb, you say by. If it's a type of light, then the noun gets no article:
To indicate the type of transportation vehicle used in the action of the verb, you say by with no article or in with an article. A specific vehicle only takes in:
To indicate a method of payment, you can say by or with, but cash normally takes in or with except as an alternative to another method. In these phrases, and many other "by" phrases for means, "by" suggests indirectness: going through something, like a route. Cash is direct: it really is the money, whereas the others are ways of transferring money via a third party.
There are various fixed phrases for special means:
When in doubt, you can substitute using for most of the prepositions above (but not the fixed phrases). But using is a somewhat hazy word, prone to be clearer to the writer than the reader. It's usually better to say something more specific, like:
None of the above is a rule, though. English works by precedents and analogies, not by rules. Just as in English common law, precedents sometimes conflict, and context can often make a normally "wrong" usage reasonable and expected.
The above is way too much to memorize. I recommend not even trying—because then you might start viewing those things as rules. Hopefully they show you how to go about learning prepositions in English: one phrase at a time, following the analogies, noting which are especially well known or canonical phrases that serve as precedents. Notice that I put the whole prepositional phrases in bold. Those are the chunks to pay attention to.