Do derivatives of operators act on the operator itself or are they "added to the tail" of operators? How do derivatives of operators work? Do they act on the terms in the derivative or do they just get "added to the tail"? Is there a conceptual way to understand this?
For example: say you had the operator $\hat{X} = x$. Would $\frac{\mathrm{d}}{\mathrm{d}x}\hat{X}$ be $1$ or $\frac{\mathrm{d}}{\mathrm{d}x}x$? The difference being when taking the expectation value, would the integrand be $\psi^*\psi$ or $\psi^*(\psi+x\frac{\mathrm{d}\psi}{\mathrm{d}x})$?
My specific question is about the band effect in solids. To get a better understanding of the system, we've used Bloch's theorem to express the wavefunction in the form $\psi = e^{iKx}u_K(x)$ where $u_K(x)$ is some periodic function. With the fact that $\psi$ solves the Schrodinger equation, we've been able to derive an "effective Hamiltonian" that $u_K$ is an eigenfunction of, $H_K = -\frac{\hbar^2}{2m}(\frac{\mathrm{d}}{\mathrm{d}x}+iK)^2+V$. My next problem is to find $\left\langle\frac{\mathrm{d}H_z}{\mathrm{d}K}\right\rangle$, which led to this question.
Some of my reasoning: An operator is a function on functions, so like all other functions we can write it as $f(g(x))$. When you take the derivative of this function, you get $f'(g(x))*g'(x)$. So looking at the operator, $\hat{X}$, we can say that it is a function on $\psi(x)$, $\hat{X}(\psi)= x\psi$. So taking the derivative gives us:
$$\frac{\mathrm{d}\hat{X}}{\mathrm{d}x} = \psi+ x\frac{\mathrm{d}\psi}{\mathrm{d}x}$$
but you could also say that $\hat{X}=x$ (not a function), so $$\frac{\mathrm{d}\hat{X}}{\mathrm{d}x} = \frac{\mathrm{d}}{\mathrm{d}x}x = 1$$
Now I'm inclined to say that $\hat{X}$ is a function, but it seems like for this question, it is better to just treat is as a constant and naively (in my opinion) take its derivative. So which way do I do it?
 A: If we leave out various subtleties related to operators, the core of OP's question (v4) seems to boil down to the following.

What is meant by 
  $$\tag{0}\frac{d}{dx}f(x)?$$ 
  Do we mean the derivative
  $$\tag{1} f^{\prime}(x),$$ 
  or do we mean the first-order differential operator that can be re-written in normal-ordered$^1$ form as 
  $$\tag{2} f^{\prime}(x)+f(x)\frac{d}{dx}?$$ 

The answer is: It depends on context. Different authors mean different things. One would have to trace carefully the author's definitions to know for sure. However, if it is written as $\frac{df(x)}{dx}$ instead, it always means $f^{\prime}(x)$, or equivalently, $[\frac{d}{dx},f(x)]$. 
--
$^1$ A differential operator is by definition normal-ordered, if all derivatives in each term are ordered to the right.
A: The rule of thumb is that you can differentiate any function with respect to its argument.
In your second example, the Hamiltonian
$$H_K=-\frac{\hbar^2}{2m}\left(\frac d{dx}+iK\right)^2+V$$
is a function of $K$: for each real $K$, you get a differential operator $H_K$. Thus (assuming everything is nice and regular and differentiable, of course) you can differentiate $H_K$ with respect to $K$. In cases like these differentiation is really noble: the chain rule and the product rule usually hold, and even most of vector calculus remains applicable. You do need to be careful, of course, when noncommuting observables are present: for example, while $\frac d {dt} e^{t\hat{A}}=\hat{A}e^{t\hat{A}}$ is true, $\frac d {dt} e^{\hat{B}+t\hat{A}}$ must be treated with some care when $\left[\hat{A},\hat{B}\right]\neq0$.
Your first example, on the other hand, doesn't quite fly. $X=\hat{x}$ is an operator that does not depend on any parameter; therefore you cannot differentiate it and $\frac{dX}{dx}$ is meaningless. Note, though, that objects like $\langle x|\psi\rangle$ are functions of $x$ and can therefore be differentiated with respect to $x$. So could, for instance, $\langle x|\hat{x}|\psi\rangle$, but only because of the dependence of the bra itself on the parameter $x$. You can also differentiate the bra:
$$-i\frac{d}{dx}\langle x|=\langle x|\hat{p}.$$
But $\hat{x}$ itself, however, you can't.
