  We study the relation between spectral flow and index theory within the
framework of (unbounded) KK-theory. In particular, we consider a generalised
notion of 'Dirac-Schr\"odinger operators', consisting of a self-adjoint
elliptic first-order differential operator D with a skew-adjoint 'potential'
given by a (suitable) family of unbounded operators on an auxiliary Hilbert
module. We show that such Dirac-Schr\"odinger operators are Fredholm, and we
prove a relative index theorem for these operators (which allows cutting and
pasting of the underlying manifolds). Furthermore, we show that the index of a
Dirac-Schr\"odinger operator represents the pairing (Kasparov product) of the
K-theory class of the potential with the K-homology class of D. We prove this
result without assuming that the potential is differentiable; instead, we
assume that the 'variation' of the potential is sufficiently small near
infinity. In the special case of the real line, we recover the well-known
equality of the index with the spectral flow of the potential.
