Writing systems vary widely (see the page on ancient scripts), and probably arose a number of times separately. All the modern Indian, and many of the south east asian, scripts ultimately derive from a script called brAhmI. This and kharoSThI were used in India in the earliest monumental writings during the maurya period (3rd-2nd cent BC), and may have originated as early as the 7th and 5th centuries respectively (see here for a map of their subsequent spread). The earlier, yet undeciphered, but probably syllabic, Indus valley script, a script which may have been of indigenous origin, had long gone out of use. In contrast, brAhmI and kharoSThI were syllabic alphabetic systems (otherwise called abigudas), not surprising given the detailed syllabic and phonemic analysis prevalent in Indian grammatical systems prior to this date. With the syllables analyzable into consituent consonantal ligatures and vowel modifiers, this was the most systematic syllabic consonantal system to that date. A writing system, hangul, which was more systematic (in marking the phonemic contrasts) was to arise in the world only two millenia later, probably again ideologically influenced by alphabetic descendants of brAhmI.
The idea of alphabetic writing in India, at least as far as it applied to kharoSThI, probably arose from the consonantal Aramaic script (a system suited for semitic, but not Indo-european languages where vowels formed parts of the word roots rather than merely being grammatical markers), an important trade language of the middle east in the first half of the first millenium BC. This in turn was a descendant, through Phoenician (end second millenium BC), of the primal consonantal script, Proto-Canaanite (Proto-Sinaitic; middle of the second millenium BC), which itself arose out of the highly logographic Egyptian hieroglyphics by the acrophonic principle. Though it is attested in the middle east only after 1800 BC, alphabetic writing may have developed in Egypt around 2000 BC, as exemplified by a possibly early Middle Kingdom inscription by a possibly asiatic employee at Wadi el-Hol. The Egyptian hieroglyphic system may have had an independent origin than the almost contemporary sumerian script.
Brahmi, originally written from right to left like its predecessor and like kharoSThI, later changed direction; and changed over time and space. By the third century BC, it had already developed some number symbols, and it is not clear whether these symbols were descendants of the aramaic system (an additive system with symbols for 1 and 4). The evolution seems to have been slight before the guptas, and in North India, therefore, we can say it changed through early and late maurya and shuGga periods, to give rise to the monumental gupta script (which was very close to the brAhmI script) around the 4th-6th century AD. About this time, the eastern Gupta character gave rise to the western siddhamAtRkA branch which gave rise to the nAgarI script which was close to its final form by the ninth century, by which time (594 AD legal document; later attestations from about 150 years later; first undisputed evidence from 876 AD) the place value system is attested (this development was, probably unrelated to the 1700 BC Babylonian base-60 place value system, though the rare use in greek documents may have influenced Indian development; it is certainly unrelated to the 7th century Mayan base 20 place value development; and there is some evidence that its early development dates to early centuries AD).
On the other hand from the eastern variant of this same eastern gupta character, proto bengali had developed by the 11th century which gave rise to the recognizably bengali script in the medieval period. The major period of change can be traced to the 7th to the 9th centuries. The western script seems to have influenced it around the 10th century, but this influence seems to go away during the reign of mahIpAla, and at least some of the letters (a, u, k, kh, g, j, dh, n, m, l, and kS) are recognizably bengali. Many more letters (about 22 of them) became distinct by the time of vijaYasena, and the process was almost complete within the next couple of centuries. The final form used today is the result of standardization due to the first printing types in 1778, with archaisms rapidly disappearing over the next century.
Early examples of writing in Bengal include third century BC prAkRta inscription in brAhmI script at mahAsthAnagaDh.a, a second century BC example from shiluYA in noYAkhAli, and the example from shushunia. Note that the use of the nAgarI script for writing saMskRta has no early example: it is a truly modern tradition.