In batch mode vc related commands doesn't work as expected. In editor mode it partially works, if we do a vc-<backend>-state before we do vc-state it gives correct state and a 'vc-recompute-state' gives correct state in any order.
I verified the latest Emacs CVS source and the behavior is still same. It works fine with vc version shipped with Emacs v21.3.
$ cat get-vc-state.el
(require 'vc-cvs)
(require 'vc)
(message "%s" (emacs-version))
(if (> emacs-major-version 21)
(message "%s" (vc-recompute-state "/tmp/myfile.sh"))
(message "%s" (vc-state "/tmp/myfile.sh")))
(message "%s" (vc-cvs-state "/tmp/myfile.sh"))
(message "%s" (vc-state "/tmp/myfile.sh"))
$