Here is a section from CGEL that directly addresses your question.
(Note that CGEL spends some time defending the claim that traditional grammar is wrong in treating the gerunds and the present participle as different verb forms, and says that instead we should speak of gerund-participles, but let's not dwell on that.)
2.3 Prepositions vs verbs
For the most part, verbs are clearly distinguishable from prepositions
by their ability to occur as head of a main clause and to inflect for
tense. There are, however, a number of prepositions that have arisen
through the conversion of secondary, non-tensed, forms of verbs:
[21] i [Barring accidents,] they should be
back today.
ii There
are five of them [ counting/including the driver].
iii [Pertaining
to the contract negotiations,] there is nothing to report.
iv [Given
his age,] a shorter prison sentence is appropriate.
The basis for analysing the underlined words here as prepositions is
that there is no understood subject. This is effectively the same
criterion as we have used in distinguishing prepositions from
adjectives: prepositions can be used in adjunct function without a
predicand, i.e. an element of which they are understood to be
predicated. The preposition counting in [ii], for example, is to be
distinguished from the gerund-participial verb-form in:
[22] [Counting his money before going to bed last
night,] Max discovered that two
$100 notes
were missing.
The boundary between the prepositional construction [21] and the
verbal [22] is slightly blurred by the usage illustrated in:
[23] i [Turning now to sales,] there are
very optimistic signs.
ii [Bearing
in mind the competitive environment,] this is a creditable
result.
iii [Having
said that,] it must be admitted that the new plan also has
advantages.
These differ from [22] in that no subject for the underlined verb is
recoverable from the matrix clause. They are similar to what
prescriptivists call the 'dangling participle' construction
illustrated in examples such as *Walking down the
street, his hat fell off, ungrammatical in the sense where it was he,
not his hat, that was walking down the street. Unlike the latter,
however, the examples in [23] are generally regarded as acceptable.
They differ from the prepositional construction in that there is still
an understood subject roughly recoverable from the context as the
speaker or the speaker and addressees together. Syntactically, they
differ from the prepositions with respect to the dependents permitted:
the verbs in [23i—ii], for example, accept the same dependents as in
tensed constructions. In [i] we have the adjunct now as well as the
complement to sales, and we could add other adjuncts such as
briefly or if I may. Similarly, in [ii] the PP complement in mind is part of the idiom bear in mind, and again we could add
adjuncts (e.g. bearing in mind, as we must, the competitive
environment). In [iii] having is a form of the perfect auxiliary,
and - unlike any preposition - takes an obligatory past-participial
complement; little expansion is possible this time, but that is
because having said that is a more or less fixed phrase in this use.
The main prepositions that are homonymous with the gerund-participle
or past participle forms of verbs are as follows:
[24] according †
T allowing F barring
†
concerning counting
excepting
excluding failing
† following including
owing
†
T pertaining
T regarding respecting
saving
†
touching
† wanting
† given gone
† BrE granted
The symbol '†' indicates that the preposition differs in
complementation and/or meaning from current usage of the verb: we have
prepositional according to Kim but not verbal *They
accorded to Kim, and so on. Gone differs from given and granted
in that the corresponding verb is not understood passively; it is
used, in informal style, with expressions of time or age as
complement: We stayed until gone midnight ("after"); He's gone 60
("over").
As prepositions, the items in [24] take an obligatory complement - an
NP, except for those marked T or F, which take a to or for
phrase respectively. The prepositions during ,notwithstanding, and
pending contain the •ing suffix, but are not homonymous with a verb.
There are also a few deverbal prepositions that take content clause
complements: given, granted, provided, providing, seeing (see Ch.
11, §4.8).
Now let's consider these sentences you asked about:
[1] a. Dave was writing with a pencil.
b. Dave was writing using a pencil.
In both [1a] and [1b], the phrase in boldface functions a means and instrument adjunct. But that function is realized by phrases of different kinds in the two sentences.
In [1a], this function is realized by the preposition phrase (PP) with a pencil. Here the preposition with is the head of the PP (CGEL, pp. 673-675).
In [1b], this same function is realized by a non-finite gerund-participial clause.
There is nothing unusual in one and the same function being realized by phrases of different kinds. Take the function of predicative complement (PC). A PC can just easily be an adjective phrase (He is very handsome) or a noun phrase (He is a doctor). When it comes to adjuncts of manner and instrument, they are most frequently realized by PPs, but they can also be realized by certain other types of phrases.
The reason why using is a verb in [1b] is just the one given in the section from CGEL reproduced above: there is an understood subject, namely Dave.